#ifndef BUTTONGROUP_H
#define BUTTONGROUP_H

#include <QMap>
#include <QToolButton>

namespace Ui {
class buttongroup;
}

class buttongroup : public QWidget
{
    Q_OBJECT

public:
    explicit buttongroup(QWidget *parent = 0);
    ~buttongroup();
protected:
    void mouseMoveEvent(QMouseEvent* event) override;
    void mousePressEvent(QMouseEvent* event) override;
public:
    void setParent(QWidget* parent);

private slots:
    void on_mw_close_clicked();

    void on_mw_min_clicked();
public slots:
    void slotButtonClick(QString text);

signals:
    void sigMyFile();
    void sigShareList();
    void sigDownload();
    void sigTransform();
    void sigSwitchUser();

private:
    Ui::buttongroup *ui;

    QPoint m_pos;
    QWidget* m_parent;

    QWidget* m_curbtn;
    class QSignalMapper* m_mapper;
    QMap<QString, QToolButton*> m_btns;
};

#endif // BUTTONGROUP_H
